[#include "/common/common.html"]
<!DOCTYPE HTML>
<html>
	<head>
		<title>权限管理</title> [#include "/common/import.html"]
	</head>
	<script type="text/javascript">
	function doDelete() {
		var ids = getChecked();
		if (ids && ids.length > 0) {
			dialog('确定要删除吗？',
					function() {
						$('#mainForm').attr('action',
								'${ctx}/admin/sys/privilege!delete.action');
						$('#mainForm').submit();
					}, true);
		} else {
			dialog('请选择要删除的记录！', true);
		}
	}
	function doUpdate() {
		var ids = getChecked();
		if (ids && ids.length == 1) {
			$('#mainForm').attr('action',
					'${ctx}/admin/sys/privilege!input.action?id=' + ids[0]);
			$('#mainForm').submit();
		} else {
			dialog('请选择一条要修改的记录！', true);
		}
	}
	function getChecked() {
		var ids = new Array();
		$('input[name^=oid]').each(function() {
			var checked = $(this).attr('checked');
			if (checked == 'checked') {
				ids.push($(this).val());
			}
		});
		return ids;
	}
	</script>
	<body>
		[@s.actionmessage theme="custom" cssClass="success" /]
		<form id="mainForm" action="${ctx}/admin/sys/privilege.action" method="post">
			<input type="hidden" name="page.pageNo" id="pageNo"
				value="${page.getPageNo()}" />
			<input type="hidden" name="page.orderBy" id="orderBy"
				value="${page.getOrderBy()}" />
			<input type="hidden" name="page.order" id="order"
				value="${page.getOrder()}" />
			<table cellpadding="0" cellspacing="1" class="tab">
				<tr>
					<th colspan="5" align="left">
						权限查询
					</th>
				</tr>
				<tr class="tdbg">
					<td align="right">
						名称：
					</td>
					<td align="center">
						<input type="text" name="filter_LIKES_name" class="input"
							value="${filter_LIKES_name!}">
					</td>
					<td align="center">
						编号：
					</td>
					<td align="center">
						<input type="text" name="filter_LIKES_code" class="input"
							value="${filter_LIKES_code!}">
					</td>
					<td align="center">
						<input type="submit" value="搜索" class="btn">
					</td>
				</tr>
			</table>

			<table cellpadding="0" cellspacing="1" class="tab">
				<tr>
					<th colspan="4" align="left">
						<a href="${ctx}/admin/sys/privilege!input.action">添加</a>
						<a href="javascript:void(0);" onclick="doDelete();">删除</a>
						<a href="javascript:void(0);" onclick="doUpdate();">修改</a>
					</th>
				</tr>
				<tr>
					<th>
						<input type="checkbox" id="checkAll" name="checkAll" />
					</th>
					<th>
						<a href="javascript:void(0);" onclick="order_by('name')">名称</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="order_by('code')">编号</a>
					</th>
					<th>
						<a href="javascript:void(0);" onclick="order_by('url')">URL</a>
					</th>
				</tr>
				<!--循环-->
				[#list page.result as entity]
				<tr class="tdbg" align="center">
					<td>
						<input type="checkbox" name="oid" value="${entity.id}" />
					</td>
					<td>
						${entity.name}
					</td>
					<td>
						${entity.code}
					</td>
					<td>
						${entity.url}
					</td>
				</tr>
				[/#list]
				<!--END.循环-->
			</table>
			<!--分页-->
			<div class="page">
				[@c.page page=page /]
			</div>
			<!--END.分页-->
		</form>

	</body>
</html>